using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using System.Threading;

namespace Tracker.Mobile.Droid.Activities
{
    [Activity(Label = "Tracker", MainLauncher = true)]
    public class Splash : BaseActivity
    {
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Splash);
            Initialize();
        }

        private void Initialize()
        {
            ThreadPool.QueueUserWorkItem(state =>
            {
                Thread.Sleep(2000);

                if (UserID == 0)
                {
                    Intent login = new Intent(this, typeof(Login));
                    StartActivity(login);
                }
                else
                {
                    Intent home = new Intent(this, typeof(Home));
                    StartActivity(home);
                }
            });
        }
    }
}